using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Runtime.Serialization;

namespace KPIS.GERP.Models.BGM
{
    [Table("bgm_strategy_data_mapping"), DataContract]
    public class StrategyDataMapping
    {
        public StrategyDataMapping()
        {
            this.StrategyDataMappings = new HashSet<StrategyDataMapping>();
        }

        [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        [DataMember, Display(Name = "BgmStratDataMapId", ResourceType = typeof(Resources.StrategyDataMappingResource))]
        [Column("bgm_strat_data_map_seq", TypeName="int")]
        public int BgmStratDataMapId { get; set; }

        [ForeignKey("BgmStratMap")]
        [DataMember, Display(Name = "BgmStratMapId", ResourceType = typeof(Resources.StrategyDataMappingResource))]
        [Column("bgm_strat_map_seq", TypeName="int")]
        public Nullable<int> BgmStratMapId { get; set; }

        [ForeignKey("BgmStratList")]
        [DataMember, Display(Name = "BgmStratListId", ResourceType = typeof(Resources.StrategyDataMappingResource))]
        [Column("bgm_strat_list_seq", TypeName="int")]
        public Nullable<int> BgmStratListId { get; set; }

        [DataMember, Display(Name = "BgmStratListCode", ResourceType = typeof(Resources.StrategyDataMappingResource))]
        [Column("bgm_strat_list_code", TypeName="ntext")]
        public string BgmStratListCode { get; set; }

        [ForeignKey("UpperBgmStratDataMap")]
        [DataMember, Display(Name = "UpperBgmStratDataMapId", ResourceType = typeof(Resources.StrategyDataMappingResource))]
        [Column("upper_bgm_strat_data_map_seq", TypeName="int")]
        public Nullable<int> UpperBgmStratDataMapId { get; set; }

        [DataMember, Display(Name = "BgmYear", ResourceType = typeof(Resources.StrategyDataMappingResource))]
        [Column("bgm_year", TypeName="int")]
        public Nullable<int> BgYear { get; set; }

        [DataMember, Display(Name = "FullPath", ResourceType = typeof(Resources.StrategyDataMappingResource))]
        [Column("full_path", TypeName="ntext")]
        public string FullPath { get; set; }

        [DataMember, Display(Name = "YearStart", ResourceType = typeof(Resources.StrategyDataMappingResource))]
        [Column("year_start", TypeName="int")]
        public Nullable<int> YearStart { get; set; }

        [DataMember, Display(Name = "YearEnd", ResourceType = typeof(Resources.StrategyDataMappingResource))]
        [Column("year_end", TypeName="int")]
        public Nullable<int> YearEnd { get; set; }

        [DataMember]
        public virtual ICollection<StrategyDataMapping> StrategyDataMappings { get; set; }

        [DataMember]
        public virtual MasStrategyMapping BgmStratMap { get; set; }

        [DataMember]
        public virtual StrategyDataList BgmStratList { get; set; }

        [DataMember]
        public virtual StrategyDataMapping UpperBgmStratDataMap { get; set; }



        #region RecordStatus

        [DataMember, Display(Name = "RecordStatus", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
        [Column("record_status", TypeName="ntext")]
        public string RecordStatus { get; set; }

        [DataMember, Display(Name = "CreatedBy", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
        [Column("created_by", TypeName="int")]
        public Nullable<int> CreatedBy { get; set; }

        [DataMember, Display(Name = "CreatedWhen", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
        [Column("created_when", TypeName="datetime2")]
        public Nullable<System.DateTime> CreatedWhen { get; set; }

        [DataMember, Display(Name = "UpdatedBy", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
        [Column("updated_by", TypeName="int")]
        public Nullable<int> UpdatedBy { get; set; }

        [DataMember, Display(Name = "UpdatedWhen", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
        [Column("updated_when", TypeName="datetime2")]
        public Nullable<System.DateTime> UpdatedWhen { get; set; }

        #endregion

    }
}